﻿CREATE TABLE [dbo].[core_userrolerelation] (
    [Id]      UNIQUEIDENTIFIER NOT NULL,
    [UserId]  UNIQUEIDENTIFIER NOT NULL,
    [RoleId]  UNIQUEIDENTIFIER NOT NULL,
    [IsMajor] BIT              NOT NULL,
    CONSTRAINT [PK_dbo.core_userrolerelation] PRIMARY KEY NONCLUSTERED ([Id] ASC),
    CONSTRAINT [FK_dbo.core_userrolerelation_dbo.core_role_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[core_role] ([Id]) ON DELETE CASCADE
);


GO
CREATE NONCLUSTERED INDEX [IX_RoleId]
    ON [dbo].[core_userrolerelation]([RoleId] ASC);

